<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title th:text="${session.title}">123</title>
    <link th:replace="common/header"/>
    <link rel="stylesheet" th:href="@{/css/ace-skins.min.css}"/>
</head>
<body class="navbar-fixed">
<div th:replace="common/top"></div>
<div class="container-fluid main_bg" id="main-container">
    <a id="menu-toggler" href="#"><span></span></a>
    <div th:replace="common/menu"></div>
    <div id="main-content" class="clearfix">
        <div id="page-content" class="clearfix">
            <div th:replace="common/title"></div>
            <div class="row-fluid">
                <!--page-content-->
                <div class="span12">
                    <div class="login-container">
                        <div class="space-6"></div>
                        <div class="row-fluid">
                            <div class="position-relative">
                                <div id="signup-box" class="visible widget-box no-border">
                                    <div class="widget-body">
                                        <div class="widget-main">
                                            <h4 class="header green lighter bigger"><em class="icon-group green"></em>个人中心
                                            </h4>
                                            <div class="space-6"></div>
                                            <p style="color: #ccc; ">个人信息</p>
                                            <form th:object="${footUser}" method="post" th:action="@{/center}"
                                                  name="form">
                                                <input type="hidden" name="id" id="id"/>
                                                <fieldset>
                                                    <label> <span class="block input-icon input-icon-right"> <input
                                                            type="text" name="name" class="span12"
                                                            placeholder="用户名"/> <em class="icon-user"></em> </span>
                                                        <span style="color:red" th:if="${#fields.hasErrors('name')}"
                                                              th:errors="*{name}">Name Error</span> </label>
                                                    <label> <span class="block input-icon input-icon-right"> <input
                                                            type="text" name="email" class="span12" placeholder="电子邮件"/> <em
                                                            class="icon-envelope"></em> </span> <span style="color:red"
                                                                                                      th:if="${#fields.hasErrors('email')}"
                                                                                                      th:errors="*{email}">Email Error</span>
                                                    </label>
                                                    <label id="game" style="display:none;"> <span
                                                            class="block input-icon input-icon-right"> <input
                                                            type="text" name="gameid" class="span12"
                                                            placeholder="游戏ID"/> <em class="icon-trophy"></em> </span>
                                                        <span style="color:red" th:if="${#fields.hasErrors('gameId')}"
                                                              th:errors="*{gameId}">Email Error</span> </label>
                                                    <div class="span12">
                                                        <label class="span6" style="color:#ccc;"> 是否参加常规赛： </label>
                                                        <label class="span3 Light"> <input type="radio" name="joins"
                                                                                           value="1"
                                                                                           onclick="getGameid(this.value);"/>
                                                            <span class="lbl">是</span> </label>
                                                        <label class="span3 Light"> <input type="radio" name="joins"
                                                                                           value="0"
                                                                                           onclick="getGameid(this.value);"/>
                                                            <span class="lbl">否</span> </label>
                                                    </div>
                                                    <div class="row-fluid">
                                                        <label class="span3"></label>
                                                        <button type="submit" class="span6 btn btn-small btn-success">
                                                            <em class="icon-lightbulb"></em>保存个人信息
                                                        </button>
                                                    </div>
                                                </fieldset>
                                            </form>
                                        </div>
                                        <!--/widget-main-->
                                        <div class="toolbar center">
                                            <a th:href="@{/index}" class="back-to-login-link"> <em
                                                    class="icon-arrow-left"></em> 返回首页 </a>
                                        </div>
                                    </div>
                                    <!--/widget-body-->
                                </div>
                                <!--/forgot-box-->
                                <!--/signup-box-->
                            </div>
                            <!--/position-relative-->
                        </div>
                    </div>
                </div>
                <!--/span-->
                <!--/#page-content-->
            </div>
        </div>
        <div th:replace="common/skin :: skin"></div>
    </div>
    <!--/#main-content-->
</div>
<!--/.fluid-container#main-container-->
<div th:replace="common/js"></div>
<input type="hidden" name="joins" id="joins" th:value="${session.footUser.joins}"/>
<script type="text/javascript">
    $(document).ready(function () {
        var radiobutton = $("#joins").val();
        if (radiobutton === 'true') {
            $("#game").show();
        }
    });

    function getGameid(value) {
        if (value === 1) {
            $("#game").show();
        } else {
            $("#game").hide();
        }
    }
</script>
</body>
</html>